using Vin.Tool.Attributes;

namespace Vin.Extension.Framework.Upload.Aliyun.Options;

[Option("VinUpload:Oss")]
public class OssOption
{
    /// <summary>
    /// 填写Bucket所在地域对应的Endpoint。以华东1（杭州）为例，Endpoint填写为https://oss-cn-hangzhou.aliyuncs.com。
    /// </summary>
    public string? Endpoint { get; set; }

    /// <summary>
    /// 访问凭证 KeyId
    /// </summary>
    public string? AccessKeyId { get; set; }

    /// <summary>
    /// 访问凭证 SecretKey
    /// </summary>
    public string? AccessKeySecret { get; set; }

    /// <summary>
    /// 填写Bucket名称，例如examplebucket。
    /// </summary>
    public string? Bucket { get; set; }

    /// <summary>
    /// 是否直接下载
    /// </summary>
    public bool Download { get; set; } = false;

    public bool IsValidate => !string.IsNullOrEmpty(Endpoint) &&
                              !string.IsNullOrEmpty(AccessKeyId) &&
                              !string.IsNullOrEmpty(AccessKeySecret) &&
                              !string.IsNullOrEmpty(Bucket);
}